﻿@model banjimange.Models.ClassModel

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <title>创建班级 - 班级管理系统</title>
</head>
<body>
    <form style="text-align:left" method="post" action="/Manage/SubmitForm" id="myForm">
        <div class="form-group" >
            <label for="username">班级名称:</label>
            <input type="text" id="ClassName" name="ClassName" required>
        </div>
        <div class="form-group">
            <label for="username">开始时间:</label>
            <input type="date" id="StartTime" name="StartTime" style="width:162.1px">
        </div>
        <div class="form-group">
            <label for="username">结束时间:</label>
            <input type="date" id="EndTime" name="EndTime" style="width:162.1px">
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:15px">班主任:</label>
            <input type="text" id="ClassOner" name="ClassOner" required>
        </div>
        <div class="form-group" style="">
            <label for="username" style="margin-right:30px">语文:</label>
            <input type="text" id="ClassChinese" name="ClassChinese" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">数学:</label>
            <input type="text" id="ClassMath" name="ClassMath" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">英语:</label>
            <input type="text" id="ClassEnglish" name="ClassEnglish" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">物理:</label>
            <input type="text" id="ClassPhysics" name="ClassPhysics" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">化学:</label>
            <input type="text" id="ClassChemistry" name="ClassChemistry" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">生物:</label>
            <input type="text" id="ClassOrganism" name="ClassOrganism" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">政治:</label>
            <input type="text" id="ClassPolitics" name="ClassPolitics" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">历史:</label>
            <input type="text" id="ClassHistory" name="ClassHistory" required>
        </div>
        <div class="form-group">
            <label for="username" style="margin-right:30px">地理:</label>
            <input type="text" id="ClassGeography" name="ClassGeography" required>
        </div>
    </form>
    <div>
        <input type="submit" value="创建" onclick="submj()" style="width: 100px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    margin-left:10px;
    background-image: linear-gradient(to right, #a6c1ee, #fbc2eb); margin-top:50px" />
    </div>
</body>
</html>
<script>
    function submj() {
        var person = {
            ClassName: document.getElementById('ClassName').value,
            ClassOner: parseInt(document.getElementById('ClassOner').value),
            ClassChinese: document.getElementById('ClassChinese').value,
            StartTime: document.getElementById('StartTime').value,
            EndTime: document.getElementById('EndTime').value,
            ClassMath: document.getElementById('ClassMath').value,
            ClassEnglish: document.getElementById('ClassEnglish').value,
            ClassPhysics: document.getElementById('ClassPhysics').value,
            ClassChemistry: document.getElementById('ClassChemistry').value,
            ClassOrganism: document.getElementById('ClassOrganism').value,
            ClassPolitics: document.getElementById('ClassPolitics').value,
            ClassHistory: document.getElementById('ClassHistory').value,
            ClassGeography: document.getElementById('ClassGeography').value
        };
        // alert(person)
        // var jsonData = JSON.stringify(person);
        // alert(jsonData)
        $.post("/Manage/SubmitForm", person, function (data) {
            if (data == "OK") {
            }
        }
        );
    }
    // function subm() {
    //     var ClassName = $("#ClassName").val();
    //     $.post("/Manage/SubmitForm", { username: ClassName }, function (data) {
    //         if (data == "OK") {
    //         }
    //         else {
    //             alert(data);
    //             $("#user").val('');
    //             $("#mima").val('');
    //         }
    //     }
    //     );
    // }
</script>